package com.dragon.refect.constructor;

import com.dragon.refect.clazz.Person;

import java.lang.reflect.Constructor;
import java.util.Arrays;

/**
 *
 * @author dragon
 * @since 2019/12/1
 */
public class ConstructorTest1 {

    public static void main(String[] args) throws Exception {
        Class<Apple> appleClass = Apple.class;
        Constructor<Apple> constructor = appleClass.getConstructor(String.class, Double.class);
        Class<?>[] parameterTypes = constructor.getParameterTypes();
        System.out.println(Arrays.toString(parameterTypes));
        Class<Apple> declaringClass = constructor.getDeclaringClass();
        System.out.println(declaringClass == appleClass);
    }
}
